{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "toc": true
   },
   "source": [
    "<h1>Table of Contents<span class=\"tocSkip\"></span></h1>\n",
    "<div class=\"toc\" style=\"margin-top: 1em;\"><ul class=\"toc-item\"></ul></div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Keras in R <a class=\"tocSkip\">"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "# example from https://keras.rstudio.com/articles/examples/mnist_mlp.html\n",
    "\n",
    "library(keras)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define hyperparameters -----------\n",
    "\n",
    "batch_size <- 128\n",
    "num_classes <- 10\n",
    "epochs <- 30"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "60000 train samples\n",
      "10000 test samples\n"
     ]
    }
   ],
   "source": [
    "# Data Preparation -----------\n",
    "\n",
    "# The data, shuffled and split between train and test sets\n",
    "c(c(x_train, y_train), c(x_test, y_test)) %<-% dataset_mnist()\n",
    "\n",
    "x_train <- array_reshape(x_train, c(nrow(x_train), 784))\n",
    "x_test <- array_reshape(x_test, c(nrow(x_test), 784))\n",
    "\n",
    "# Transform RGB values into [0,1] range\n",
    "x_train <- x_train / 255\n",
    "x_test <- x_test / 255\n",
    "\n",
    "cat(nrow(x_train), 'train samples\\n')\n",
    "cat(nrow(x_test), 'test samples\\n')\n",
    "\n",
    "# Convert class vectors to binary class matrices\n",
    "y_train <- to_categorical(y_train, num_classes)\n",
    "y_test <- to_categorical(y_test, num_classes)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "________________________________________________________________________________\n",
      "Layer (type)                        Output Shape                    Param #     \n",
      "================================================================================\n",
      "dense_26 (Dense)                    (None, 256)                     200960      \n",
      "________________________________________________________________________________\n",
      "dropout_14 (Dropout)                (None, 256)                     0           \n",
      "________________________________________________________________________________\n",
      "dense_27 (Dense)                    (None, 128)                     32896       \n",
      "________________________________________________________________________________\n",
      "dropout_15 (Dropout)                (None, 128)                     0           \n",
      "________________________________________________________________________________\n",
      "dense_28 (Dense)                    (None, 10)                      1290        \n",
      "================================================================================\n",
      "Total params: 235,146\n",
      "Trainable params: 235,146\n",
      "Non-trainable params: 0\n",
      "________________________________________________________________________________\n"
     ]
    }
   ],
   "source": [
    "# Define Model ---------------\n",
    "\n",
    "model <- keras_model_sequential()\n",
    "model %>% \n",
    "  layer_dense(units = 256, activation = 'relu', input_shape = c(784)) %>% \n",
    "  layer_dropout(rate = 0.4) %>% \n",
    "  layer_dense(units = 128, activation = 'relu') %>%\n",
    "  layer_dropout(rate = 0.3) %>%\n",
    "  layer_dense(units = 10, activation = 'softmax')\n",
    "\n",
    "summary(model)\n",
    "\n",
    "model %>% compile(\n",
    "  loss = 'categorical_crossentropy',\n",
    "  optimizer = optimizer_rmsprop(),\n",
    "  metrics = c('accuracy')\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0gAAANICAMAAADKOT/pAAADAFBMVEUAAAABAQECAgIDAwME\nBAQFBQUGBgYHBwcICAgJCQkKCgoLCwsMDAwNDQ0ODg4PDw8QEBARERESEhITExMUFBQVFRUW\nFhYXFxcYGBgZGRkaGhobGxscHBwdHR0eHh4fHx8gICAhISEiIiIjIyMkJCQlJSUmJiYnJyco\nKCgpKSkqKiorKyssLCwtLS0uLi4vLy8wMDAxMTEyMjIzMzM0NDQ1NTU2NjY3Nzc4ODg5OTk6\nOjo7Ozs8PDw9PT0+Pj4/Pz9AQEBBQUFCQkJDQ0NERERFRUVGRkZHR0dISEhJSUlKSkpLS0tM\nTExNTU1OT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VXirgduXLbkdo26rYjtSSY9vKvq4RxJH1Hymyu\n3XDS9IHGZBSjzTnGX8Gky6gGpIEbAxzyd9q9hys36rbDPU7CWkmcdd+R2jbqvj/s9z7G7slN\nSKXzev+mzGZ/5zwZF9h2qZtnfx8aVjWw2YIsN7Zo7fe79XCtjbrrcH8mVlLdd6RUo+77w+7u\nVSWo0cPXhayuI8X9SAAwACIBwACIBAADIBIADIBIADAAIgHAAIgEAAMgEgAMgEgAMAAiAcAA\niAQAAyASAAyASAAwACIBwACIBAADIBIADIBIADDg/8oRfTpp4RACAAAAAElFTkSuQmCC",
      "text/plain": [
       "plot without title"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Training the model --------\n",
    "history <- model %>% fit(\n",
    "  x_train, y_train,\n",
    "  batch_size = batch_size,\n",
    "  epochs = epochs,\n",
    "  verbose = 1,\n",
    "  validation_split = 0.2\n",
    ")\n",
    "\n",
    "plot(history)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test loss: 0.1128517 \n",
      "Test accuracy: 0.9816 \n"
     ]
    }
   ],
   "source": [
    "# Evaluate the model --------\n",
    "\n",
    "score <- model %>% evaluate(\n",
    "  x_test, y_test,\n",
    "  verbose = 0\n",
    ")\n",
    "\n",
    "# Output metrics\n",
    "cat('Test loss:', score[[1]], '\\n')\n",
    "cat('Test accuracy:', score[[2]], '\\n')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "R 3.4.2",
   "language": "R",
   "name": "ir342"
  },
  "language_info": {
   "codemirror_mode": "r",
   "file_extension": ".r",
   "mimetype": "text/x-r-source",
   "name": "R",
   "pygments_lexer": "r",
   "version": "3.4.3"
  },
  "toc": {
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": true,
   "toc_cell": true,
   "toc_position": {},
   "toc_section_display": "block",
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
